﻿@model List<ScrumPilot.Domain.Models.User>
@{
    ViewBag.Title = "Users List";
}
@section HeadContent{
    <link href="@Url.Content("~/Content/UsersList.css")" rel="stylesheet" type="text/css" />
}
@section AddJavaScript
{
    <script type="text/javascript" src='@Url.Content("~/Scripts/UsersList.js")'></script>
    <script type="text/javascript">
        var myPage = new UsersList();
    </script>
}
@section JSDocumentReady
{
myPage.Ready();
}
@section PageOptionUrl
{
    '@Url.Action("SetUsersListFilter", "User")','@Url.Action("CheckUsers", "User")',
    '@Url.Action("SynchronizeTFSUsers", "User")',
    '@Url.Action("GetWorkItems", "User")' 
}
@section PageOptionsOpt
{
    isFiltered: @ViewBag.IsFilteredList
}
<div class="row-fluid">

    <h1 style="float: left; margin-right: 20px;">Users List
    </h1>
    @if (ViewBag.isAdmin)
    {
        <button id="checkusers" class="btn btn-info btn-large" style="float: left;">
            Check users</button>
    }

    <div id="radio" style="float: left;">
        <label class="radio">
            <input type="radio" id="radio1" value="0" />
            <span class="metro-radio">Followed  users</span>
        </label>
        <label class="radio">
            <input type="radio" id="radio2" value="1" />
            <span class="metro-radio">All users</span>
        </label>
    </div>


    <ul class="userline">
        @foreach (var item in Model)
        {
            <li class="well well-small">
                <div>
                    <img src="@Url.Action("ShowPhoto64", "AsyncData")/@item.ID" alt="@item.Name" title="@item.Name" style="float: left" />
                    <div style="margin: 0 4px 0 4px; float: left">
                        <h3 style="clear: both">
                            <a href="@Url.Action("UserView")/@item.ID">@item.Name</a>
                            @if (item.Followed)
                            {
                                <img alt="follow" src="@Url.Content("~/Content/img/Star.png")" title="You follow this user" />
                            }</h3>
                        <a href="mailto:@item.Mail">@item.Mail</a>
                        <p>@item.Account</p>
                    </div>
                    <div class="well well-small blockInfo pull-right">
                        <p class="lead"><strong id="score_@item.ID">N/A</strong></p>
                        <span><small>Score</small></span>
                    </div>
                    <div class="well well-small blockInfo pull-right">
                        <p class="lead"><strong id="hours_@item.ID">N/A</strong></p>
                        <span><small>Hours</small></span>
                    </div>
                    <div class="well well-small blockInfo pull-right">
                        <p class="lead"><strong id="tasks_@item.ID">N/A</strong></p>
                        <span><small>Tasks in progress/done</small></span>
                    </div>

                </div>
                <div class="userlinecontent" data-index="@item.ID">
                    <p>
                        User Stories in progress:
                        <img id="imgldw_@item.ID" src="~/Content/img/ajax-loader-l.gif" alt="Loading..."/>
                        <span class="wip" id="wip_@item.ID"></span>
                    </p>
                    <p>
                        Tasks in progress:
                            <img id="imglts_@item.ID" src="~/Content/img/ajax-loader-l.gif" alt="Loading..."/>
                        <span class="lts" id="lts_@item.ID"></span>
                    </p>
                    <p>
                        Bugs in progress:
                            <img id="imglbg_@item.ID" src="~/Content/img/ajax-loader-l.gif" alt="Loading..."/>
                        <span class="lbg" id="lbg_@item.ID"></span>
                    </p>
                    <p>
                        <small>Pending changes:
                            <img id="imgldp_@item.ID" src="~/Content/img/ajax-loader-l.gif" alt="Loading..." />
                            <span class="pcs" id="pcs_@item.ID"></span></small>
                    </p>
                </div>
            </li>
        }
    </ul>
</div>
